import Vue from "vue";
import VueRouter from "vue-router";
import PostList from '@/components/PostList'
import Article from '@/components/Article'
import SideBar from '@/components/SideBar'
import UserInfo from '@/components/UserInfo'
Vue.use(VueRouter)
const routes = [
    {
        path:'/',
        name:'root',
        components:{
            main:PostList
        }
    },
    {
        path:'/user/:id&author=:name',
        name:'post_content',
        components:{
            main:Article,
            sidebar:SideBar
        }
    },
    {
        path:'/user/:name',
        name:'user_info',
        components:{
            main:UserInfo,
        }
    }

]
const router = new VueRouter({
    mode:'history',
    routes
})
export default router